Skip to content

id: bind the unkeyed-export trust decision in ingest_import - #13637

Merged
dezren39 merged 1 commit into
mainfrom
lane-oc5-13389
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
lane-oc5-13389

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

ingest_import now binds the VerifiedImport token's unkeyed_export trust decision to the export being ingested: when verified.unkeyed_export != export.manifest.unkeyed_export it returns ImportError::VerificationMismatch before any event-store write — the same refusal path the binding/ID/count checks already use.

Previously a token minted for a keyed export could authorize ingesting an unkeyed (service-signed) export, skipping the operator confirmation verify_import requires for unkeyed exports.

Tests

Two regression tests in hosted_ingest::tests, built on a helper that produces the keyed and unkeyed shapes of one export from a single binding (identical binding ID, Iroh ID, objects, and blobs — only the manifest's trust flag and signer differ):

  • a_keyed_token_cannot_ingest_an_unkeyed_export — the keyed token is refused against the unkeyed export and nothing lands; the mirror image (confirmed unkeyed token against the keyed export) is refused too.
  • a_confirmed_unkeyed_token_ingests_its_unkeyed_export — the explicitly confirmed unkeyed pair keeps working (report complete, 3 objects + 1 blob applied).

Verification (laptop worktree runs, nix develop in pkgs/id, sccache disabled per #13367):

  • cargo test --lib hosted_ingest: 7 passed, 0 failed.
  • cargo test -p id --lib: 578 passed, 0 failed, 1 ignored.
  • rustfmt --check on the touched file: clean.

Closes #13389


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

ingest_import checked the VerifiedImport token's binding ID, Iroh
ID, and entry counts against the export, but not its unkeyed_export
trust decision — so a token minted for a keyed export could
authorize ingesting an unkeyed (service-signed) export without the
operator confirmation verify_import requires.

Reject with VerificationMismatch before any event-store write when
verified.unkeyed_export differs from the manifest's, and add
regression tests: a keyed token cannot ingest the unkeyed shape of
the same export (nor the reverse), while an explicitly confirmed
unkeyed token still ingests its unkeyed export.

Closes #13389
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b25ad328-9561-4358-a7a7-ff995acf5dff
Commits

Reviewing files that changed from the base of the PR and between 0645099 and 3e3f6cc.

Files selected for processing: 1

  • pkgs/id/src/hosted_ingest.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit b6efed9 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the lane-oc5-13389 branch November 23, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id: reject hosted imports with a mismatched unkeyed-export token

1 participant